Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, I recently submitted changes to fix spelling mistakes in this repository (#3808).
Based on the discussion, I also wanted to improve the general quality of comments in the repository (e.g. grammatical errors, periods, capital letters, markdown formatting).
Simple spelling mistakes are relatively easy to detect and fix with regular spell checkers and some manual intervention, but the formatting and grammar of comments is more difficult to fix with those types of tools.
The approach I took here is to create a Rust parser (using
nom
) to extract comments from Rust files and feed them to thegpt-4-turbo
large language model to suggest improvements.The current prompt for the model is:
The suggested changes are then manually reviewed by me one by one.
This draft PR includes changes to
12
files in thebridges
directory just to showcase what the resulting changes look like.The cost of the OpenAI API requests is about
0.45
USD per10
average files.Given that the whole repository has about
3570
files, the estimate for the full repository would be somewhere around160.0
USD in API credits.Note: I also tried doing this with local
ollama
models but the results were not as good as GPT4.Also, it takes me about about
30-60
seconds to review the changes to each file, so doing this to all the files would be somewhere in the ballpark of30-50
hours.The verification process looks something like this from my end:
I wanted to gauge the interest for these changes, and if there is interest, if some funding could be provided to cover the API and time cost.
@joepetrowski @bkchr What do you think?